package com.zxl.register.server.event;

import com.zxl.register.base.Event;
import lombok.Data;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

@Data
public class EventPool {

    private static volatile Queue<Event> eventPool=new ConcurrentLinkedQueue<>();


    public static boolean needProcess(){
        return !eventPool.isEmpty();
    }


    public static void push(Event event){
        eventPool.add(event);
    }


    public static Event poll(){
       return eventPool.poll();
    }
}
